package com.wql.cloud.controller;

import com.wql.cloud.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello1")
public class HelloController {
	@Autowired
	private HelloService helloService;
	
	@RequestMapping("/hi1")
	public String hi(String name){
		System.out.println("访问feign的HelloController.hi()");
		if("error".equalsIgnoreCase(name)){
			throw new RuntimeException("名字是error，抛个异常玩玩");
		}
		String hi = helloService.feignhi();
		return "feign-内容:"+hi;
	}
}
